--Me da weba simplificar y acomodar x_x
--Lo bueno es que sirve xD
--Hecho de todos modos y ni cuenta me dí o_O wtf¿

--El centro de la pantalla se veia muy vacío cuando
--juegan de dos. Arreglado, ahora van en el medio
--juntitos y sin zooms, además con eso quité un buen
--de code en este lua...

--menos variables = menos kb's = mas confuso xD

--este apartado es para poner parámetros a la
--hora de cargar un lua mediante un LoadActor()
local player = ...
assert(player)
--up

local t = Def.ActorFrame {}

for i=0,1 do

t[#t+1] = LoadFont("IMPACT")..{
	InitCommand=function(self)
		(cmd(shadowlength,0))(self);
		self:maxwidth(i == 0 and 75 or 175);
	end;
	ChangeCommand=function(self)
		local CurSteps
		local Description = ""
		
		if GAMESTATE:GetCurrentSong() then
			CurSteps = GAMESTATE:GetCurrentSteps(player)
			Description = CurSteps:GetDescription()
		elseif GAMESTATE:GetCurrentCourse() then
			CurSteps = GAMESTATE:GetCurrentTrail(player)
		else
			return;
		end
		
		local Texts = Diffstring2(CurSteps:GetDifficulty(),CurSteps:GetStepsType(),Description)
		local DefZoom = i == 0 and 2 or 0.8
		
		--Si despues de un self sigue otro self se tiene que poner punto y coma ( ; ).
		--Si son codes de lua como allá arriba no hace falta ponerlos, pero si se
		--te dificulta cuándo sí y cuándo no se usan ponlos de todos modos, no pasa nada.
		self:settext(Texts[i+1]);
		self:stoptweening();
		self:y(i * 34);	-- n * 0 = 0
		
		--[[self:rotationy(0)
		if CurSteps:IsAutogen() then
			self:rotationy(180)
		end]]
		
		self:zoom(DefZoom*1.2);
		self:glow(MeterColor2(CurSteps:GetMeter()));
		self:decelerate(0.2);
		self:zoom(DefZoom);
		self:glow(1,1,1,0);
		self:diffusealpha(1);
	end;
	CurrentStepsP1ChangedMessageCommand=function(self)
		if player == PLAYER_1 then
			self:playcommand("Change");
		end;
	end;
	CurrentStepsP2ChangedMessageCommand=function(self)
		if player == PLAYER_2 then
			self:playcommand("Change");
		end;
	end;
	CurrentTrailP1ChangedMessageCommand=function(self)
		if player == PLAYER_1 then
			self:playcommand("Change");
		end;
	end;
	CurrentTrailP2ChangedMessageCommand=function(self)
		if player == PLAYER_2 then
			self:playcommand("Change");
		end;
	end;
	CurrentSongChangedMessageCommand=function(self)
		local song = GAMESTATE:GetCurrentSong()
		if not song then
			self:stoptweening();
			self:decelerate(0.2);
			self:zoomx(3);
			self:zoomy(0);
			self:diffusealpha(0);
		end
	end;
}

end

t[#t+1] = LoadFont("piusysfont")..{
	InitCommand=cmd(shadowlength,0;y,-30;glowshift;effectclock,'Beat';effecttiming,0,0,1,0;effectcolor1,0,0,0,1;effectcolor2,1,1,1,1;zoom,0.8);
	ChangeCommand=function(self)
		--no song, do nothing
		if not GAMESTATE:GetCurrentSong() then return end
		local CurSteps = GAMESTATE:GetCurrentSteps(player)
		local bAutogen = CurSteps:IsAutogen() and "AUTOGEN" or ""
		self:settext(bAutogen);
	end;
	CurrentStepsP1ChangedMessageCommand=cmd(playcommand,"Change");
	CurrentStepsP2ChangedMessageCommand=cmd(playcommand,"Change");
	--CurrentTrailP1ChangedMessageCommand=cmd(playcommand,"Change");
	--CurrentTrailP2ChangedMessageCommand=cmd(playcommand,"Change");
	CurrentSongChangedMessageCommand=function(self)
		local song = GAMESTATE:GetCurrentSong()
		if not song then
			self:visible(false)
		return end
		self:visible(true)
	end;
}

return t